package com.meida.student.app.common.controller;

import com.meida.common.base.entity.EntityMap;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.module.user.provider.service.SysHtmlService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * html接口
 *
 * @author gp
 */
@RestController
@RequestMapping("/html/")
public class ApiHtmlController {

    @Autowired
    private SysHtmlService sysHtmlService;

    @ApiOperation(value = "html-列表", notes = "html列表")
    @GetMapping(value = "queryListByHtmlType")
    public ResultBody list(Integer htmlType, Integer htmlGroup) {
        List<EntityMap> list = sysHtmlService.listByHtmlType(htmlType, htmlGroup, criteriaQuery -> {
            criteriaQuery.select("htmlId", "htmlTitle");
        });
        return ResultBody.ok(list);
    }
}
